var mongodb = require('mongoose');
mongodb.connect('mongodb://ip:port/test');//；连接数据库
     var db = mongodb.connection;
      db.on('error', console.error.bind(console, 'connection error:'));
      db.once('open', function (callback) {
         console.log(new Date(),'MongoDB connected');
      });
exports.db = mongodb;